namespace TXK
{
	public class S7Message : INetMessage
	{
		public int ProtocolHeadBytesLength => 4;

		public byte[] HeadBytes { get; set; }

		public byte[] ContentBytes { get; set; }

		public byte[] SendBytes { get; set; }

		public bool CheckHeadBytesLegal(byte[] token)
		{
			if (this.HeadBytes == null)
			{
				return false;
			}
			if (this.HeadBytes[0] == 3 && this.HeadBytes[1] == 0)
			{
				return true;
			}
			return false;
		}

		public int GetContentLengthByHeadBytes()
		{
			byte[] headBytes;
			headBytes = this.HeadBytes;
			if (headBytes != null && headBytes.Length >= 4)
			{
				return this.HeadBytes[2] * 256 + this.HeadBytes[3] - 4;
			}
			return 0;
		}

		public int GetHeadBytesIdentity()
		{
			return 0;
		}
	}
}
